*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*				Working from Home, Commuting, and Gender                      /
*               Journal of Population Economics                               /
*                                                                             /
*               Authors: Markus Nagler, Johannes Rincke, Erwin Winkler        /
*                                                                             /
*               Do file 1: generate results                                   /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

use "$orig\WFH.dta", clear



*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                        Table 1: Descriptives                                /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


gen nowfh=telecomm==1
label var nowfh "No WFH"
gen wfh2=telecomm==2
label var wfh2 "WFH up to 2 days"
gen wfh5=telecomm==3
label var wfh5 "WFH up to 5 days"

gen sched_flex=flex==1
label var sched_flex "Flexible schedule"

gen dlines_sometimes=dlines==1
label var dlines_sometimes "Sometimes"
gen dlines_often=dlines==2 
label var dlines_often "Often"
gen dlines_never=dlines==3
label var dlines_never "Never"

gen mtask_sometimes=mtask==1
label var mtask_sometimes "Sometimes"
gen mtask_often=mtask==2 
label var mtask_often "Often"
gen mtask_never=mtask==3
label var mtask_never "Never"

label var daysoff "Paid days off"

gen comm15=commtime==1 
label var comm15 "0-15 minutes"
gen comm30=commtime==2 
label var comm30 "16-30 minutes"
gen comm45=commtime==3 
label var comm45 "31-45 minutes"
gen comm60=commtime==4 
label var comm60 "46-60 minutes"
gen comm60plus=commtime==5 
label var comm60plus "$>$60 minutes"

label var hours "Weekly work hours"
label var wage2 "Gross hourly wage"

save "$data\temp",replace


eststo clear
eststo:  estpost summarize nowfh wfh2 wfh5  
eststo:  estpost summarize nowfh wfh2 wfh5 if female==1
eststo:  estpost summarize nowfh wfh2 wfh5 if female==0
eststo:  estpost summarize nowfh wfh2 wfh5 if inlist(education,1,2,3)
eststo:  estpost summarize nowfh wfh2 wfh5 if inlist(education,4,5,6,7)
eststo:  estpost summarize nowfh wfh2 wfh5 if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize sched_flex  
eststo:  estpost summarize sched_flex if female==1
eststo:  estpost summarize sched_flex if female==0
eststo:  estpost summarize sched_flex if inlist(education,1,2,3)
eststo:  estpost summarize sched_flex if inlist(education,4,5,6,7)
eststo:  estpost summarize sched_flex if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize sched_flex  
eststo:  estpost summarize sched_flex if female==1
eststo:  estpost summarize sched_flex if female==0
eststo:  estpost summarize sched_flex if inlist(education,1,2,3)
eststo:  estpost summarize sched_flex if inlist(education,4,5,6,7)
eststo:  estpost summarize sched_flex if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often  
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if female==1
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if female==0
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if inlist(education,1,2,3)
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if inlist(education,4,5,6,7)
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often  
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if female==1
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if female==0
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if inlist(education,1,2,3)
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if inlist(education,4,5,6,7)
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize daysoff  
eststo:  estpost summarize daysoff if female==1
eststo:  estpost summarize daysoff if female==0
eststo:  estpost summarize daysoff if inlist(education,1,2,3)
eststo:  estpost summarize daysoff if inlist(education,4,5,6,7)
eststo:  estpost summarize daysoff if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus  
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if female==1
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if female==0
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if inlist(education,1,2,3)
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if inlist(education,4,5,6,7)
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear
eststo:  estpost summarize hours  
eststo:  estpost summarize hours if female==1
eststo:  estpost summarize hours if female==0
eststo:  estpost summarize hours if inlist(education,1,2,3)
eststo:  estpost summarize hours if inlist(education,4,5,6,7)
eststo:  estpost summarize hours if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear
eststo:  estpost summarize wage2  
eststo:  estpost summarize wage2 if female==1
eststo:  estpost summarize wage2 if female==0
eststo:  estpost summarize wage2 if inlist(education,1,2,3)
eststo:  estpost summarize wage2 if inlist(education,4,5,6,7)
eststo:  estpost summarize wage2 if inlist(education,8,9)

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace







*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                        Figure 1: Baseline estimates                         /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_flex]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

local i=`i'+1
nlcom (1-exp((_b[dc_daysoff_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

local i=`i'+1
nlcom (1-exp((_b[dc_daysoff_35]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 8 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) ylabel(20 "{bf:Working from home} (ref: no working from home)" 19 "up to 2 days" 18 "up to 5 days" 16 "{bf:Flexibility of schedule}" 14 "{bf:Paid days off} (ref: 25 days)" 13 "30 days" 12 "35 days" 10 "{bf:Avoid commuting time} (ref: 15 mins)" 9 "30 mins" 8 "45 mins" 7 "60 mins", angle(0)  labsize(medium)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(6 21)) xscale(range(0 25)  titlegap(4))  xsize(6) xlabel(0(5)25)   graphregion(margin(large)) scale(0.9) 

restore

}










*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                        Figure 2: Heterogeneities                            /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////



*********************** Panel A: WFH 2 days ***********************************
{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,1,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,4,5,6,7), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 6 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -2 in `i'

keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(5.376462, lpattern(dash) lcolor(gs8) lwidth(vthin))  ylabel(20 "{bf:All}" 18 "{bf:Gender}" 17 "Female" 16 "Male" 14 "{bf:Age}" 13 "20-29" 12 "30-39" 11 "40-49" 10 "50-60" 8 "{bf:Education}" 7 "Low" 6 "Medium" 5 "High" 3 "{bf:Wage quintile}" 2 "1st (lowest)" 1 "2nd" 0 "3rd" -1 "4th" -2 "5th (highest)", angle(0)  labsize(small)) xtitle(Estimated WTP for WFH (2 days) in % of wage)  ysize(4)  yscale(range(-3 21)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}



*********************** Panel B: WFH 5 days ***********************************

{

preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,1,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,4,5,6,7), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 6 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -2 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(7.709746, lpattern(dash) lcolor(gs8) lwidth(vthin))  ylabel(20 "{bf:All}" 18 "{bf:Gender}" 17 "Female" 16 "Male" 14 "{bf:Age}" 13 "20-29" 12 "30-39" 11 "40-49" 10 "50-60" 8 "{bf:Education}" 7 "Low" 6 "Medium" 5 "High" 3 "{bf:Wage quintile}" 2 "1st (lowest)" 1 "2nd" 0 "3rd" -1 "4th" -2 "5th (highest)", angle(0)  labsize(small)) xtitle(Estimated WTP for WFH (5 days) in % of wage)  ysize(4)  yscale(range(-3 21)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore
}














*******************************************************************************
*                                                                             *
*          FIGURE 3: Interaction between WFH and commuting                    *
*                                                                             *
*******************************************************************************


***************** Panel A: WTP for WFH, depending on commuting time ***********

{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'


local i=`i'+1
nlcom (1-exp(((_b[d_tele_2]+_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((_b[d_tele_2]+_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((_b[d_tele_2]+_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'


local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((_b[d_tele_5]+_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'



local i=`i'+1
nlcom (1-exp(((_b[d_tele_5]+_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'


local i=`i'+1
nlcom (1-exp(((_b[d_tele_5]+_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{bf: WFH up to 2 days (ref: no WFH)}" 20 "Commuting time 15 mins" 19 "30 mins" 18 "45 mins" 17 "60 mins" 15 "{bf: WFH up to 5 days (ref: no WFH)}" 14 "Commuting time 15 mins" 13 "30 mins" 12 "45 mins" 11 "60 mins" , angle(0)  labsize(medium)) xtitle(Estimated WTP for WFH in % of wage)  ysize(4)  yscale(range(10 22)) xscale(range(0 20)  titlegap(4))  xsize(6) xlabel(0(5)20)   graphregion(margin(large)) scale(0.9) 



restore

}




***************** Panel B: WTP to avoid commuting, depending on WFH *******************************
{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5  d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'





local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 8 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'






keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) ylabel(20 "{bf:Commuting time 30mins (ref: 15mins)}" 19 "No WFH" 18 "WHF up to 2 days" 17 "WFH up to 5 days" 15 "{bf:Commuting time 45mins (ref: 15mins)}" 14 "No WFH" 13 "WFH up to 2 days" 12 "WFH up to 5 days" 10 "{bf: Commuting time 60mins (ref: 15 mins)}" 9 "No WFH" 8 "WFH up to 2 days" 7 "WFH up to 5 days", angle(0)  labsize(medium)) xtitle(Estimated WTP to avoid commuting time in % of wage)  ysize(4)  yscale(range(6 21)) xscale(range(0 25)  titlegap(4))  xsize(6) xlabel(0(5)25)   graphregion(margin(large)) scale(0.9) 



restore

}









*******************************************************************************
*                                                                             *
*          FIGURE 4: Does WFH reduce the gender commuting gap?                *
*                                                                             *
*******************************************************************************

******************* Panel A: WTP to avoid commute by gender ********************
{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{bf:Females}" 20 "Commuting time 30 mins" 19 "45 mins" 18 "60 mins" 16 "{bf: Males}" 15 "30 mins" 14 "45 mins" 13 "60 mins", angle(0)  labsize(medium)) xtitle(Estimated WTP to avoid commute in % of wage)  ysize(4)  yscale(range(12 22)) xscale(range(0 30) titlegap(4))  xsize(5) xlabel(0(5)30)   graphregion(margin(large)) scale(0.9) 



restore

}




******************* Panel B: WTP to avoid commute by gender and WFH ************

{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -3 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(30, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(35, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{it:Females}"  20 "{bf: Commuting time 30mins (ref: 15mins)}" 19 "No WFH" 18 "WFH up to 2 days" 17 "WFH up to 5 days" 16 "{bf:Commuting time 45mins (ref: 15mins)}" 15 "No WFH" 14 "WFH up to 2 days" 13 "WFH up to 5 days"  12 "{bf: Commuting time 60mins (ref: 15mins)}" 11 "No WFH" 10 "WFH up to 2 days" 9 "WFH up to 5 days"  7 "{it: Males}" 6 "{bf: Commuting time 30mins (ref: 15mins)}" 5 "No WFH" 4 "WFH up to 2 days" 3 "WFH up to 5 days" 2 "{bf: Commuting time 45mins (ref: 15mins)}" 1 "No WFH" 0 "WFH up to 2 days" -1 "WFH up to 5 days" -2 "{bf: Commuting time 60mins (ref: 15mins)}" -3 "No WFH" -4 "WFH up to 2 days" -5 "WFH up to 5 days", angle(0)  labsize(small)) xtitle(Estimated WTP to avoid commute in % of wage)  ysize(4)  yscale(range(-6 22)) xscale(range(0 35) titlegap(4))  xsize(6) xlabel(0(5)35)   graphregion(margin(large)) scale(0.9) 



restore

}






*******************************************************************************
*                                                                             *
*          FIGURE 5: The role of children                                     *
*                                                                             *
*******************************************************************************


* Males vs. childless females

{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & anychildren==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -3 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(30, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(35, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{it: Females (no children)}"  20 "{bf: Commuting time 30mins (ref: 15mins)}" 19 "No WFH" 18 "WFH up to 2 days" 17 "WFH up to 5 days" 16 "{bf:Commuting time 45mins (ref: 15mins)}" 15 "No WFH" 14 "WFH up to 2 days" 13 "WFH up to 5 days"  12 "{bf: Commuting time 60mins (ref: 15mins)}" 11 "No WFH" 10 "WFH up to 2 days" 9 "WFH up to 5 days"  7 "{it: Males}" 6 "{bf: Commuting time 30mins (ref: 15mins)}" 5 "No WFH" 4 "WFH up to 2 days" 3 "WFH up to 5 days" 2 "{bf: Commuting time 45mins (ref: 15mins)}" 1 "No WFH" 0 "WFH up to 2 days" -1 "WFH up to 5 days" -2 "{bf: Commuting time 60mins (ref: 15mins)}" -3 "No WFH" -4 "WFH up to 2 days" -5 "WFH up to 5 days", angle(0)  labsize(small)) xtitle(Estimated WTP to avoid commute in % of wage)  ysize(4)  yscale(range(-6 22)) xscale(range(0 35) titlegap(4))  xsize(6) xlabel(0(5)35)   graphregion(margin(large)) scale(0.9) 



restore

}






* Males age 40+ vs. childless females age 40+

{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & anychildren==0 &age>3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if  female==0 & age>3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -3 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(30, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(35, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{it: Females (no children, age 40+)}"  20 "{bf: Commuting time 30mins (ref: 15mins)}" 19 "No WFH" 18 "WFH up to 2 days" 17 "WFH up to 5 days" 16 "{bf:Commuting time 45mins (ref: 15mins)}" 15 "No WFH" 14 "WFH up to 2 days" 13 "WFH up to 5 days"  12 "{bf: Commuting time 60mins (ref: 15mins)}" 11 "No WFH" 10 "WFH up to 2 days" 9 "WFH up to 5 days"  7 "{it: Males (age 40+)}" 6 "{bf: Commuting time 30mins (ref: 15mins)}" 5 "No WFH" 4 "WFH up to 2 days" 3 "WFH up to 5 days" 2 "{bf: Commuting time 45mins (ref: 15mins)}" 1 "No WFH" 0 "WFH up to 2 days" -1 "WFH up to 5 days" -2 "{bf: Commuting time 60mins (ref: 15mins)}" -3 "No WFH" -4 "WFH up to 2 days" -5 "WFH up to 5 days", angle(0)  labsize(small)) xtitle(Estimated WTP to avoid commute in % of wage)  ysize(4)  yscale(range(-6 22)) xscale(range(0 35) titlegap(4))  xsize(6) xlabel(0(5)35)   graphregion(margin(large)) scale(0.9) 



restore

}














*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                              APPENDIX                                       /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*        Figure A3: Baseline results for those who passed attention check     /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


{
logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if attent1==1 & attent2==1, vce(cluster ls_id)

preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

local i=`i'+1
nlcom (1-exp((_b[d_flex]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp((_b[dc_daysoff_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

local i=`i'+1
nlcom (1-exp((_b[dc_daysoff_35]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 8 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) ylabel(20 "{bf:Working from home} (ref: no working from home)" 19 "up to 2 days" 18 "up to 5 days" 16 "{bf:Flexibility of schedule}" 14 "{bf:Paid days off} (ref: 25 days)" 13 "30 days" 12 "35 days" 10 "{bf:Avoid commuting time} (ref: 15 mins)" 9 "30 mins" 8 "45 mins" 7 "60 mins", angle(0)  labsize(medium)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(6 21)) xscale(range(0 25)  titlegap(4))  xsize(6) xlabel(0(5)25)   graphregion(margin(large)) scale(0.9) 



restore
}




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*        Figure A4: Experiment vs. hedonic wage regressions                   /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


{
preserve
cap gen telecomm2 = telecomm==2
cap gen telecomm5 = telecomm==3

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


reg ln_wage2 telecomm2 telecomm5 female i.age i.education often_multitask i.daysoff flex i.commtime , cl(id)

local i=`i'+1
nlcom ((exp(_b[telecomm2])-1)*(-1))*(100)
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'

replace counter = 17 in `i'

local i=`i'+1
nlcom ((exp(_b[telecomm5])-1)*(-1))*(100)
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.

twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-30, lpattern(dash) lcolor(gs13) lwidth(vthin)) ylabel(21 "{bf: Experimental estimates}" 20 "WFH up to 2 days" 19 "up to 5 days" 18 "{bf: Hedonic wage regression}" 17 "up to 2 days" 16 "up to 5 days", angle(0)  labsize(medium)) xtitle(Estimated WTP for WFH in % of wage)  ysize(4)  yscale(range(15 22)) xscale(range(-30 10))  xsize(5) xlabel(-30(5)10)   graphregion(margin(large)) scale(0.9) 



restore
}






*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*               Table A2: Descriptives by age and wage quintile               /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////



eststo clear 
eststo:  estpost summarize nowfh wfh2 wfh5 if age==2
eststo:  estpost summarize nowfh wfh2 wfh5 if age==3
eststo:  estpost summarize nowfh wfh2 wfh5 if age==4
eststo:  estpost summarize nowfh wfh2 wfh5 if age==5
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==1
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==2
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==3
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==4
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear 
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==2
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==3
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==4
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==5
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==1
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==2
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==3
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==4
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear 
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==2
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==3
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==4
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==5
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==1
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==2
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==3
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==4
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear 
eststo:  estpost summarize sched_flex if age==2
eststo:  estpost summarize sched_flex if age==3
eststo:  estpost summarize sched_flex if age==4
eststo:  estpost summarize sched_flex if age==5
eststo:  estpost summarize sched_flex if quint==1
eststo:  estpost summarize sched_flex if quint==2
eststo:  estpost summarize sched_flex if quint==3
eststo:  estpost summarize sched_flex if quint==4
eststo:  estpost summarize sched_flex if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace





eststo clear 
eststo:  estpost summarize daysoff if age==2
eststo:  estpost summarize daysoff if age==3
eststo:  estpost summarize daysoff if age==4
eststo:  estpost summarize daysoff if age==5
eststo:  estpost summarize daysoff if quint==1
eststo:  estpost summarize daysoff if quint==2
eststo:  estpost summarize daysoff if quint==3
eststo:  estpost summarize daysoff if quint==4
eststo:  estpost summarize daysoff if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear 
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==2
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==3
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==4
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==5
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==1
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==2
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==3
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==4
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear 
eststo:  estpost summarize hours if age==2
eststo:  estpost summarize hours if age==3
eststo:  estpost summarize hours if age==4
eststo:  estpost summarize hours if age==5
eststo:  estpost summarize hours if quint==1
eststo:  estpost summarize hours if quint==2
eststo:  estpost summarize hours if quint==3
eststo:  estpost summarize hours if quint==4
eststo:  estpost summarize hours if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear 
eststo:  estpost summarize wage2 if age==2
eststo:  estpost summarize wage2 if age==3
eststo:  estpost summarize wage2 if age==4
eststo:  estpost summarize wage2 if age==5
eststo:  estpost summarize wage2 if quint==1
eststo:  estpost summarize wage2 if quint==2
eststo:  estpost summarize wage2 if quint==3
eststo:  estpost summarize wage2 if quint==4
eststo:  estpost summarize wage2 if quint==5

*esttab using "", cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*         Table A3: Descriptives on attributes of hypothetical jobs           /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

preserve

gen teleA_0 =(telecommA=="nein")
gen commtimeA_15=(commtimeA==15)
gen daysoffA_25=(daysoffA==25)

label var earnA "Hourly wage"
label var teleA_0 "No WFH"
label var teleA_2 "WFH up to 2 days"
label var teleA_5 "WFH up to 5 days"
label var commtimeA_15 "Commuting time 15 minutes"
label var commtimeA_30 "Commuting time 30 minutes"
label var commtimeA_45 "Commuting time 45 minutes"
label var commtimeA_60 "Commuting time 60 minutes"
label var flexA "Flexible schedule"
label var daysoffA_25 "25 paid days off"
label var daysoffA_30 "30 paid days off"
label var daysoffA_35 "35 paid days off"
label var hoursA "Weekly work hours"


eststo clear
eststo:  estpost tabstat earnA teleA_0 teleA_2 teleA_5 commtimeA_15 commtimeA_30 commtimeA_45 commtimeA_60 flexA daysoffA_25 daysoffA_30 daysoffA_35 hoursA, c(stat) stat(n mean sd) 


*esttab using "", cells("mean(fmt(%9.2f)) sd(fmt(%9.2f)) count(fmt(%9.0f))") collabels("Mean" "SD" "N") noobs nomtitle compress nonumber label  replace

restore




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*        Figure A5: Distribution of paid days off among survey respondents    /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

histogram daysoff, discrete percent xtitle(Number of paid days off per year)
histogram daysoff if education>=8, discrete percent xtitle(Number of paid days off per year)



*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                  Table A4: Logit estimates                                  /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)
estimates store r1

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1, vce(cluster ls_id)
estimates store r2

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)
estimates store r3

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*  if female==1 & attent1==1 & attent2==1, vce(cluster ls_id)
estimates store r4

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*  if female==0 & attent1==1 & attent2==1, vce(cluster ls_id)
estimates store r5


*estout  r1 r2 r3 r4 r5 using "" , cells(b(fmt(2) star) se(fmt(2) par))  stats(r2_p, fmt(%9.2f) labels( `" Pseudo R2"')) ///
starlevels(`"\sym{*}"' 0.10 `"\sym{**}"' 0.05 `"\sym{***}"' 0.01, label(" \(p<@\)")) delimiter(&) end(\\) ///
prefoot("\hline") label mlabels(none) nonumbers collabels(none) keep(d_earn d_flex d_tele_5 d_tele_2 dc_daysoff* dc_commtime_* d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5) order (treatment ) eqlabels("", begin("\hline" "") nofirst) notype ///
level(95) style(esttab)  replace






*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                     Figure A6: Sorting into WFH                             /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{

preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if telecomm!=1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'


logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if telecomm==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'





keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(19 "{bf:WFH >0 days in current job}" 18 "WTP up to 5 days" 17 "WTP up to 2 days" 16 "{bf:No WFH in current job}" 15 "WTP up to 5 days" 14 "WTP up to 2 days", angle(0)  labsize(medium)) xtitle(Estimated WTP to work from home in % of wage)  ysize(4)  yscale(range(13 20)) xscale(range(0 15) titlegap(4))  xsize(6) xlabel(0(5)15)   graphregion(margin(large))  



restore
}




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                     Figure A7: Sorting into commuting                       /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////



{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


gen commtime_30=commtime>2 //above 30 minutes commuting time

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if commtime_30==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60 ]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'



logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if commtime_30==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60 ]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(19 "{bf:Yes}" 18 "WTP 30 mins" 17 "WTP 45 mins" 16 "WTP 60 mins" 15 "{bf:No}" 14 "WTP 30 mins" 13 "WTP 45 mins" 12 "WTP 60 mins", angle(0)  labsize(medium)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(11 20)) xscale(range(0 25) titlegap(4))  xsize(6) xlabel(0(5)25)   graphregion(margin(large))  



restore

}




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*          Figure A8: Heterogeneity of WTP for WFH with imputed wages         /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

* Use random forest to predict wages for missings

preserve

rforest wage2 female age education telecomm flex mtask dlines commtime if wage2!=., type(reg) iterations(3000) numvars(3) lsize(25) seed(141015)

predict wage_imp if wage2==.
replace wage2 = wage_imp if wage2==.

sum wage2

xtile quint_imp = wage2, nq(5)
sum quint quint_imp





*********************** Panel A: WFH 2 days ***********************************

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 8 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'



logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_2]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'





keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{bf:1st quintile}" 20 "Baseline" 19 "Including imputed" 17 "{bf: 2nd quintile}" 16 "Baseline" 15 "Including imputed" 13 "{bf:3rd quintile}" 12 "Baseline" 11 "Including imputed" 9 "{bf:4th quintile}" 8 "Baseline" 7 "Including imputed" 5 "{bf:5th quintile}" 4 "Baseline" 3 "Including imputed", angle(0)  labsize(small)) xtitle(Estimated WTP for WFH (2 days) in % of wage)  ysize(4)  yscale(range(21 2)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 


restore




preserve

rforest wage2 female age education telecomm flex mtask dlines commtime if wage2!=., type(reg) iterations(3000) numvars(3) lsize(25) seed(141015)

predict wage_imp if wage2==.
replace wage2 = wage_imp if wage2==.

sum wage2

xtile quint_imp = wage2, nq(5)
sum quint quint_imp





*********************** Panel B: WFH 5 days ***********************************

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 8 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'



logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint_imp==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_tele_5]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'





keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{bf:1st quintile}" 20 "Baseline" 19 "Including imputed" 17 "{bf: 2nd quintile}" 16 "Baseline" 15 "Including imputed" 13 "{bf:3rd quintile}" 12 "Baseline" 11 "Including imputed" 9 "{bf:4th quintile}" 8 "Baseline" 7 "Including imputed" 5 "{bf:5th quintile}" 4 "Baseline" 3 "Including imputed", angle(0)  labsize(small)) xtitle(Estimated WTP for WFH (5 days) in % of wage)  ysize(4)  yscale(range(21 2)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 


restore

















*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*                     Figure A9: Inequality                                   /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////



use "$data\temp.dta",clear


gen low_edu=inlist(education,1,2,3)
gen high_edu=inlist(education,8,9)
gen med_edu=(low_edu==0 | high_edu==0)

gen has_tele_2 = telecomm==2
gen has_tele_5 = telecomm==3

gen has_nodlines = (dlines==1 | dlines==3)
gen has_nomtask = (mtask==1 | mtask==3)

gen has_flex = (flex==1)

gen has_daysoff30 = inlist(daysoff,28,29,30,31,32)
gen has_daysoff35 = inlist(daysoff,33,35,35)

gen has_commtime30 = commtime==2
gen has_commtime45 = commtime==3
gen has_commtime60 = inlist(commtime,4,5)




preserve

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""



*** High vs low education

cap prog drop boot_ineq
program define boot_ineq


gen ln_comp=.
gen ln_comp_tot=.

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if high_edu==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1

cap drop sum_amenities


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if low_edu==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1


cap drop coef_d_tele_2 coef_d_tele_5 coef_wage sum_amenities

* wage gap
sum ln_wage2 if high_edu==1
gen wage_g1 = r(mean)
sum ln_wage2 if low_edu==1
gen wage_g2 = r(mean)
gen wage_gap = wage_g1-wage_g2
sum wage_gap 
scalar wage_gap = r(mean)
di wage_gap

* compensation gap (wfh)
sum ln_comp if high_edu==1
gen comp_g1 = r(mean)
sum ln_comp if low_edu==1
gen comp_g2 = r(mean)
gen comp_gap = comp_g1-comp_g2
sum comp_gap
scalar comp_gap = r(mean)
di comp_gap

cap drop comp_g1 comp_g2

* compensation gap (all amenities)
sum ln_comp_tot if high_edu==1
gen comp_g1 = r(mean)
sum ln_comp_tot if low_edu==1
gen comp_g2 = r(mean)
gen comp_gap_tot = comp_g1-comp_g2
sum comp_gap_tot
scalar comp_gap_tot = r(mean)
di comp_gap_tot



gen diff_wfh = comp_gap-wage_gap 
sum diff_wfh 
scalar diff_wfh = r(mean)
di diff_wfh

gen diff_tot = comp_gap_tot-wage_gap 
sum diff_tot 
scalar diff_tot = r(mean)
di diff_tot

cap drop ln_comp ln_comp_tot wage_g1 wage_g2 comp_g1 comp_g2 wage_gap comp_gap comp_gap_tot diff_wfh diff_tot sum_amenities

reg ln_wage2

end 


bootstrap wage_gap comp_gap comp_gap_tot diff_wfh diff_tot, seed(2205) reps(200) cluster(ls_id): boot_ineq




local i=`i'+1
mat b = e(b)
replace b = b[1,1] in `i'
mat se = e(se)
replace se = se[1,1] in `i'
replace counter = 20 in `i'


local i=`i'+1
mat b = e(b)
replace b = b[1,2] in `i'
mat se = e(se)
replace se = se[1,2] in `i'
replace counter = 19 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,4] in `i'
mat se = e(se)
replace se = se[1,4] in `i'
replace counter = 18 in `i'


local i=`i'+1
mat b = e(b)
replace b = b[1,3] in `i'
mat se = e(se)
replace se = se[1,3] in `i'
replace counter = 17 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,5] in `i'
mat se = e(se)
replace se = se[1,5] in `i'
replace counter = 16 in `i'










*** 80th vs. 20th percentile

cap prog drop boot_ineq
program define boot_ineq


gen ln_comp=.
gen ln_comp_tot=.

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if quint==1

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==1

cap drop sum_amenities

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if quint==2

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==2

cap drop sum_amenities

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if quint==3

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==3

cap drop sum_amenities

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if quint==4

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==4

cap drop sum_amenities

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]

replace ln_comp = ln( wage2 + wage2 * ( 1- exp( ((_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5)/_b[d_earn] *(-1) ) ) ) ) if quint==5

replace ln_comp_tot = ln( wage2 + wage2 * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==5


cap drop coef_d_tele_2 coef_d_tele_5 coef_wage sum_amenities

* wage gap
_pctile ln_wage2, nq(100)
gen p_75 = `r(r80)'
gen p_25 = `r(r20)'
gen wage_gap = p_75-p_25
sum wage_gap 
scalar wage_gap = r(mean)
di wage_gap

cap drop p_75 p_25

* compensation gap
_pctile ln_comp, nq(100)
gen p_75 = `r(r80)'
gen p_25 = `r(r20)'
gen comp_gap = p_75-p_25
sum comp_gap 
scalar comp_gap = r(mean)
di comp_gap

cap drop p_75 p_25

* compensation gap
_pctile ln_comp_tot, nq(100)
gen p_75 = `r(r80)'
gen p_25 = `r(r20)'
gen comp_gap_tot = p_75-p_25
sum comp_gap_tot 
scalar comp_gap_tot = r(mean)
di comp_gap_tot


gen diff_wfh = comp_gap-wage_gap 
sum diff_wfh 
scalar diff_wfh = r(mean)
di diff_wfh

gen diff_tot = comp_gap_tot-wage_gap 
sum diff_tot 
scalar diff_tot = r(mean)
di diff_tot

cap drop ln_comp ln_comp_tot p_75 p_25 wage_gap comp_gap comp_gap_tot diff_wfh diff_tot sum_amenities

reg ln_wage2

end 


bootstrap wage_gap comp_gap comp_gap_tot diff_wfh diff_tot, seed(2205) reps(200) cluster(ls_id): boot_ineq




local i=`i'+1
mat b = e(b)
replace b = b[1,1] in `i'
mat se = e(se)
replace se = se[1,1] in `i'
replace counter = 13 in `i'


local i=`i'+1
mat b = e(b)
replace b = b[1,2] in `i'
mat se = e(se)
replace se = se[1,2] in `i'
replace counter = 12 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,4] in `i'
mat se = e(se)
replace se = se[1,4] in `i'
replace counter = 11 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,3] in `i'
mat se = e(se)
replace se = se[1,3] in `i'
replace counter = 10 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,5] in `i'
mat se = e(se)
replace se = se[1,5] in `i'
replace counter = 9 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.




twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(0.05, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.1, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.2, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.3, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.35, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.4, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.45, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.55, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.6, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.65, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.7, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.75, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.8, lpattern(dash) lcolor(gs13) lwidth(vthin)) ylabel(21 "{bf:High vs. low education}" 20 "(1) Wage" 19 "(2) Wage + WFH" 18 "{it:Difference (2) - (1)}" 17 "(3) Wage + all amenities" 16 "{it:Difference (3) - (1)}" 14 "{bf:80th vs. 20th percentile}" 13 "(1) Wage" 12 "(2) Wage + WFH" 11 "{it:Difference (2) - (1)}" 10 " (3) Wage + all amenities" 9 "{it:Difference (3) - (1)}", angle(0)  labsize(small)) xtitle(Log difference)  ysize(4)  yscale(range(8 22)) xscale(range(0 0.6)  titlegap(4))  xsize(5) xlabel(0(0.1)0.8)   graphregion(margin(large)) scale(0.9) 


restore





*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*       Figure A10: Female Sample: Splits by Children's Characteristics       /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

*** Panel A




{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & inrange(age_youngest,0,10), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & inrange(age_youngest,11,18), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -3 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(30, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(35, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{it: Females, youngest child 0-10 years}"  20 "{bf: Commuting time 30mins (ref: 15mins)}" 19 "No WFH" 18 "WFH up to 2 days" 17 "WFH up to 5 days" 16 "{bf:Commuting time 45mins (ref: 15mins)}" 15 "No WFH" 14 "WFH up to 2 days" 13 "WFH up to 5 days"  12 "{bf: Commuting time 60mins (ref: 15mins)}" 11 "No WFH" 10 "WFH up to 2 days" 9 "WFH up to 5 days"  7 "{Females, youngest child 11-18 years}" 6 "{bf: Commuting time 30mins (ref: 15mins)}" 5 "No WFH" 4 "WFH up to 2 days" 3 "WFH up to 5 days" 2 "{bf: Commuting time 45mins (ref: 15mins)}" 1 "No WFH" 0 "WFH up to 2 days" -1 "WFH up to 5 days" -2 "{bf: Commuting time 60mins (ref: 15mins)}" -3 "No WFH" -4 "WFH up to 2 days" -5 "WFH up to 5 days", angle(0)  labsize(small)) xtitle(Estimated WTP to avoid commute in % of wage)  ysize(4)  yscale(range(-6 22)) xscale(range(0 35) titlegap(4))  xsize(6) xlabel(0(5)35)   graphregion(margin(large)) scale(0.9) 



restore

}






*** Panel B


{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & household_children_u18<2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 9 in `i'


logit jobA d_earn d_flex d_tele_5 d_tele_2 d_int_commtime30_tele_2 d_int_commtime45_tele_2 d_int_commtime60_tele_2 d_int_commtime30_tele_5 d_int_commtime45_tele_5 d_int_commtime60_tele_5 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & household_children_u18>1 & !missing(household_children_u18), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_30]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_30]-_b[d_int_commtime30_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 3 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_45]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_45]-_b[d_int_commtime45_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'



local i=`i'+1
nlcom (1-exp((-_b[dc_commtime_60]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -3 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_2])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -4 in `i'


local i=`i'+1
nlcom (1-exp(((-_b[dc_commtime_60]-_b[d_int_commtime60_tele_5])/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(30, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(35, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{it: Females, 0-1 child}"  20 "{bf: Commuting time 30mins (ref: 15mins)}" 19 "No WFH" 18 "WFH up to 2 days" 17 "WFH up to 5 days" 16 "{bf:Commuting time 45mins (ref: 15mins)}" 15 "No WFH" 14 "WFH up to 2 days" 13 "WFH up to 5 days"  12 "{bf: Commuting time 60mins (ref: 15mins)}" 11 "No WFH" 10 "WFH up to 2 days" 9 "WFH up to 5 days"  7 "{Females, 2+ children}" 6 "{bf: Commuting time 30mins (ref: 15mins)}" 5 "No WFH" 4 "WFH up to 2 days" 3 "WFH up to 5 days" 2 "{bf: Commuting time 45mins (ref: 15mins)}" 1 "No WFH" 0 "WFH up to 2 days" -1 "WFH up to 5 days" -2 "{bf: Commuting time 60mins (ref: 15mins)}" -3 "No WFH" -4 "WFH up to 2 days" -5 "WFH up to 5 days", angle(0)  labsize(small)) xtitle(Estimated WTP to avoid commute in % of wage)  ysize(4)  yscale(range(-6 22)) xscale(range(0 35) titlegap(4))  xsize(6) xlabel(0(5)35)   graphregion(margin(large)) scale(0.9) 



restore

}








































